package com.zmzncs.lmtc.module.park.controller;


import com.zmzncs.lmtc.common.pojo.ChnnelsBody;
import com.zmzncs.lmtc.common.pojo.LoginUser;
import com.zmzncs.lmtc.common.pojo.Rest;
import com.zmzncs.lmtc.common.pojo.daoer.CreateMonth;
import com.zmzncs.lmtc.common.pojo.daoer.GateOnOff;
import com.zmzncs.lmtc.common.util.JwtUtil;
import com.zmzncs.lmtc.common.util.RestUtil;
import com.zmzncs.lmtc.module.park.pojo.park_info.ParkManagerParkInfoDTO;
import com.zmzncs.lmtc.module.park.pojo.park_manager.ParkInfoSpaceForm;
import com.zmzncs.lmtc.module.park.pojo.park_manager.ParkManagerAddForm;
import com.zmzncs.lmtc.module.park.service.ParkInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;


/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 任建波
 * @since 2020-09-29
 */
@Api(tags = "停车场信息")
@RestController
@RequestMapping("/park/park-info")
@Validated
public class ParkInfoController {

    @Autowired
    ParkInfoService parkInfoService;


    @ApiOperation(value = "修改车场车位信息")
    @PostMapping("audit-parkinfo-space")
    public Rest auditReserve(@RequestBody @Valid ParkInfoSpaceForm form){
        int result = parkInfoService.updateParkInfoSpaceForm(form);
        return RestUtil.success(result);
    }


    @ApiOperation(value = "车场主管理车场列表信息")
    @GetMapping("getParkManageParkInfoByManage")
    public Rest getParkManageParkInfoByManage(){
        List<ParkManagerParkInfoDTO> list = parkInfoService.getParkManageParkInfoByManageId();
        return RestUtil.success(list);
    }


}

